﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using System.Runtime.Serialization;
using System.Linq;
using System.Text;

namespace Returns
{
    public partial class tblAddress : EntityObject
    {
        public string FullAddress
        {
            get
            {
                return Address1 +
                    (((Address2 ?? string.Empty) == string.Empty) ? string.Empty : "\n" + Address2) +
                    (((Address3 ?? string.Empty) == string.Empty) ? string.Empty : "\n" + Address3) +
                    ((City == null) ? string.Empty : "\n" + City) +
                    ((State == null) ? string.Empty : ", " + State) +
                    PostalCode;
            }
        }
    }

    public partial class tblInventoryTransaction : EntityObject
    {
        public Int32 NegQty
        {
            get { return 0 - Qty; }
        }
    }

    public partial class tblReturnDetail : EntityObject
    {
        private Int32 _qtyToStock = 0;

        public Int32 QtyToStock
        {
            get { return _qtyToStock; }
            set 
            {
                _qtyToStock = value;
                ReportPropertyChanged("QtyToStock");
            }
        }
    }

    public partial class tblInventoryTransactionDetail : EntityObject
    {
        private bool _returnToInventory = false;
        private bool _returnDamaged = false;

        public bool ReturnToInventory 
        {
            get { return _returnToInventory; }
            set
            {
                OnPropertyChanging("ReturnDamaged");
                OnPropertyChanging("ReturnToInventory");
                _returnToInventory = value;
                _returnDamaged = false;
                OnPropertyChanged("ReturnDamaged");
                OnPropertyChanged("ReturnToInventory");
            }
        }

        public bool ReturnDamaged
        {
            get { return _returnDamaged; }
            set
            {
                OnPropertyChanging("ReturnDamaged");
                OnPropertyChanging("ReturnToInventory");
                _returnDamaged = value;
                _returnToInventory = false;
                OnPropertyChanged("ReturnDamaged");
                OnPropertyChanged("ReturnToInventory");
            }
        }
    }
    public class PackageSearch : global::System.Data.Objects.DataClasses.EntityObject
    {
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public string SearchKeyType { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        [DataMemberAttribute()]
        public Int32 PackageID { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        [DataMemberAttribute()]
        public Int32 CustomerID { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        [DataMemberAttribute()]
        public Int32 OrderID { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public string Name { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public string Address1 { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public string City { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public string State { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public string PostalCode { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public DateTime? OrderDate { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public DateTime? ShippedDate { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public String TrackingNumber { get; set; }
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = true)]
        [DataMemberAttribute()]
        public String Owner { get; set; }

        public string FullAddress
        {
            get
            {
                return Address1 + 
                    ((City == null) ? string.Empty : "\n" + City) +
                    ((State == null) ? string.Empty : ", " + State) +
                    PostalCode;
            }
        }
    }
}
